
package com.catsic.zcjc.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.catsic.base.BaseServiceImpl;
import com.catsic.base.exception.CatsicException;
import com.catsic.core.exception.CatsicExceptionCode;
import com.catsic.zcjc.constants.ZcjcConstants;
import com.catsic.zcjc.dao.DistrictDao;
import com.catsic.zcjc.entity.District;
import com.catsic.zcjc.service.DistrictService;


@Service("districtService")
public class DistrictServiceImpl extends BaseServiceImpl<District, Long> implements DistrictService{
	
	/**
	 * DistrictDao:区县Dao
	 */
	@Autowired
	private DistrictDao districtDao;
	
	

	@Override
	public District findById(Long id){
		District District = getById(id);
		if(null == District){
			throw new CatsicException(CatsicExceptionCode.实体不存在, ZcjcConstants.DISTRICT);
		}
		return District;
	}
	

	
	@Override
	public List<District> findByCity(Long cityId) {
		return districtDao.findByCity(cityId);
	}
	
	
}
